<?php

  define('ACC', true);
require('./include/init.php');
session_start(); 
//print_r($_SESSION);
$userid = $_SESSION['user_id'];

echo '<head><meta charset = "utf-8"></head>'; 

echo '<h2>生成财务报表&nbsp|&nbsp<a href = "account_balance.php">返回分类账簿页面</a></h2><br/>';    

$company = new companymodel();
$companyinfo = $company->getcompanyinfo($userid);
$companyid = $companyinfo['company_id'];
$accounting = new accountingmodel();
$companyy = $companyinfo['company_y'];  
$companyq = $companyinfo['company_q']; 

$result = $accounting->generatefinancialreports($companyid, $companyy, $companyq);
if($result==true){
    echo '生成财务报表成功！&nbsp&nbsp<a href="financial_reports.php">查看财务报表</a>';
}else{
    echo '生成财务报表失败！';
}



?>
